package com.uzai.common.enums;

/**
 * 用户黑名单类型
 * @Auther: jianghan
 * @Date: 2021/8/17 11:10
 * @Description:
 */
public enum UserBlackTypeEnum {
    NORMAL(0,"常规"),
    SWIPE(1,"刷单"),
    SIMILAR(2,"同行"),
    SHOP(3,"店淘"),
    EXTORT(4,"敲诈"),
    DOG(5,"撸狗");

    private Integer value;
    private String desc;

    UserBlackTypeEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static UserBlackTypeEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (UserBlackTypeEnum type: UserBlackTypeEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }

}
